package net.lanelife.casino.caipiao.entity.statistics.support;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.MappedSuperclass;

import net.lanelife.casino.caipiao.entity.User;
import net.lanelife.casino.common.entity.annotation.Checked;

@MappedSuperclass
public abstract class BaseUserStatistics<PK extends Serializable> extends BaseStatistics<PK> {

	private static final long serialVersionUID = 6460708239109320248L;
	
	// ================================= 用户信息 =================================

	@Checked
	@Column(name = "USER_ID", nullable = false)
	protected Integer userId;

	@Checked
	@Column(name = "USER_NAME", length = 16, nullable = false)
	protected String userName;

	@Checked
	@Column(name = "PARENT_ID")
	protected Integer parentId;

	@Checked
	@Column(name = "PARENT_NAME", length = 16)
	protected String parentName;

	@Checked
	@Column(name = "FLOOR", nullable = false)
	protected Integer floor;

	@Checked
	@Column(name = "PATH", length = 200)
	protected String path;
	
	public BaseUserStatistics() {}
	
	public BaseUserStatistics(User user) {
		this.userId = user.getId();
		this.userName = user.getUserName();
		this.parentId = user.getParentId();
		this.parentName = user.getParentName();
		this.floor = user.getFloor();
		this.path = user.getPath();
	}

}
